package com.mybatisplus.demo.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mybatisplus.demo.entity.Student;
import com.mybatisplus.demo.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


/**
 * @Description: 测试
 * @Author: shafei
 * @Date: 2019-10-11
 * @Version: V1.0
 */
@Controller
@RequestMapping("/test")
public class TestController {

    @Autowired
    private StudentService studentService;

    @GetMapping("/test")
    @ResponseBody
    public List<Student> getRedisTest(){
        QueryWrapper<Student> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("name","shafei");
        List<Student> students = studentService.selectAll(queryWrapper);
        return students;
    }
}
